package jee.boot.common.basic;

import jee.boot.entity.system.Filter;
/**
 * 逻辑删除Service基类,逻辑删除功能改为在CrudController中增加logicDelete接口
 */
@Deprecated
public abstract class LogicDeleteCrudService<D extends CrudDao<T>, T extends DataEntity<T>> extends CrudService<D, T> {
    @Override
    public Page<T> findPage(T entity) {
        // 添加有效数据过滤
        if(entity!=null){
            entity.addFilter(new Filter("status","<>",DataEntity.DATA_STATUS_DELETED));
        }
        return super.findPage(entity);
    }

    @Override
    public void delete(T entity) {
        // 使用逻辑删除
        super.logicDelete(entity);
    }
}
